package com.jinx.demo_log.page;

import com.baomidou.mybatisplus.plugins.Page;

import java.util.List;
import java.util.Map;

public class CustomPage<T>  {

    //当前页数
    private int page;

    //每页显示数量
    private int pagesize;

    //总条数
    private long records;

    //数据列表
    private List<T> rows;

    //总页数
    private long total;

    //排序字段
    private String orderByField;

    //是否升序
    private boolean isAsc;

    //其余字段
    private Integer obj;

    //其余字段
    private Map map;

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getPagesize() {
        return pagesize;
    }

    public void setPagesize(int pagesize) {
        this.pagesize = pagesize;
    }

    public long getRecords() {
        return records;
    }

    public void setRecords(long records) {
        this.records = records;
    }

    public List<T> getRows() {
        return rows;
    }

    public void setRows(List<T> rows) {
        this.rows = rows;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public String getOrderByField() {
        return orderByField;
    }

    public void setOrderByField(String orderByField) {
        this.orderByField = orderByField;
    }

    public boolean isAsc() {
        return isAsc;
    }

    public void setAsc(boolean isAsc) {
        this.isAsc = isAsc;
    }

    public Integer getObj() {
        return obj;
    }

    public void setObj(Integer obj) {
        this.obj = obj;
    }

    public Map getMap() {
        return map;
    }

    public void setMap(Map map) {
        this.map = map;
    }

    public CustomPage() {
    }

    public CustomPage(Page<T> page) {
        this.page = page.getCurrent();
        this.pagesize = page.getSize();
        this.records = page.getTotal();
        this.rows = page.getRecords();
        this.total = page.getPages();
        this.orderByField = page.getOrderByField();
        this.isAsc = page.isAsc();
    }
}
